#include "stdafx.h"
#include "Fakes/FakeD3D10Texture1D.h"
#include "Fakes/FakeD3D10Texture2D.h"
#include "Fakes/FakeD3D10Texture3D.h"

DESCRIPTION_10_TEST_SUITE(ShaderTexture1DArrayViewDescription)

BOOST_FIXTURE_TEST_CASE(Default, TestShaderTexture1DArrayViewDescription)
{
	BOOST_REQUIRE_EQUAL(D3D10_SRV_DIMENSION_TEXTURE1DARRAY, m_desc.ViewDimension);
	BOOST_REQUIRE_EQUAL(DXGI_FORMAT_UNKNOWN, m_desc.Format);
	BOOST_REQUIRE_EQUAL(0, m_desc.Texture1DArray.MostDetailedMip);
	BOOST_REQUIRE_EQUAL(~0U, m_desc.Texture1DArray.MipLevels);
	BOOST_REQUIRE_EQUAL(0, m_desc.Texture1DArray.FirstArraySlice);
	BOOST_REQUIRE_EQUAL(~0U, m_desc.Texture1DArray.ArraySize);
}

#define SHADER_TEXTURE1D_ARRAY_VIEW_DESCRIPTION_TEST_CASE(type_, name_, value_) \
	DESCRIPTION_10_FIXTURE_TEST_CASE(name_##_, ShaderTexture1DArrayViewDescription, \
		type_, value_, Texture1DArray.name_)

SHADER_TEXTURE1D_ARRAY_VIEW_DESCRIPTION_TEST_CASE(UINT, MipLevels, 2)
SHADER_TEXTURE1D_ARRAY_VIEW_DESCRIPTION_TEST_CASE(UINT, MostDetailedMip, 2)
SHADER_TEXTURE1D_ARRAY_VIEW_DESCRIPTION_TEST_CASE(UINT, FirstArraySlice, 2)
SHADER_TEXTURE1D_ARRAY_VIEW_DESCRIPTION_TEST_CASE(UINT, ArraySize, 2)

TEXTURE1D_SETTER_TEST_CASE(MipLevels, TestShaderTexture1DArrayViewDescription, Texture1DArray.MipLevels, UINT, 2)
TEXTURE2D_SETTER_TEST_CASE(MipLevels, TestShaderTexture1DArrayViewDescription, Texture1DArray.MipLevels, UINT, 2)
TEXTURE3D_SETTER_TEST_CASE(MipLevels, TestShaderTexture1DArrayViewDescription, Texture1DArray.MipLevels, UINT, 2)

TEXTURE1D_SETTER_TEST_CASE(ArraySize, TestShaderTexture1DArrayViewDescription, Texture1DArray.ArraySize, UINT, 2)
TEXTURE2D_SETTER_TEST_CASE(ArraySize, TestShaderTexture1DArrayViewDescription, Texture1DArray.ArraySize, UINT, 2)

BOOST_AUTO_TEST_SUITE_END()
